export function debounceFun(fn: Fn, delay: number = 200) {
  if(typeof fn !== 'function') {
    throw new TypeError('fn不是函数')
  }

  let timer = null
  return function(this: any, ...args: any) {
    if (timer) {
      clearTimeout(timer)
    }

    timer = setTimeout(fn.bind(this, ...args), delay)
  }
}
